package sketchpad.gui.drawinggraph;

import javafx.scene.canvas.GraphicsContext;
import sketchpad.constant.Config;
import sketchpad.constant.Geometry;
import sketchpad.gui.drawinggraph.node.Node;

import java.io.Serializable;

//所有几何信息的基类
public class DrawItem implements Serializable {

    private int id;//方便查找
    private String label;//标识信息
    private String color;//颜色
    private Geometry geometryClass;
    private Node leftUpNode;
    private Node rightDownNode;
    private boolean isUpdate;
    private int groupId;
    private boolean isSelect;

    public DrawItem(int id, Node node){
        label = "";
        color = "#fff";
        isUpdate = false;
        groupId = Config.SELECT_ID;
        isSelect = false;
        leftUpNode = node;
        rightDownNode = node;
        this.id = id;
    }

    /*继承用
    * */
    public void draw(Node mouseNode, GraphicsContext gc){}

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getLabel() {
        return label;
    }

    public void setLabel(String label) {
        this.label = label;
    }

    public String getColor() {
        return color;
    }

    public void setColor(String color) {
        this.color = color;
    }

    public Geometry getGeometryClass() {
        return geometryClass;
    }

    public void setGeometryClass(Geometry geometryClass) {
        this.geometryClass = geometryClass;
    }

    public Node getLeftUpNode() {
        return leftUpNode;
    }

    public void setLeftUpNode(Node leftUpNode) {
        this.leftUpNode = leftUpNode;
    }

    public Node getRightDownNode() {
        return rightDownNode;
    }

    public void setRightDownNode(Node rightDownNode) {
        this.rightDownNode = rightDownNode;
    }

    public boolean isUpdate() {
        return isUpdate;
    }

    public void setUpdate(boolean update) {
        isUpdate = update;
    }

    public int getGroupId() {
        return groupId;
    }

    public void setGroupId(int groupId) {
        this.groupId = groupId;
    }

    public boolean isSelect() {
        return isSelect;
    }

    public void setSelect(boolean select) {
        isSelect = select;
    }
}
